package com.zzw.hj56;

import java.util.Scanner;

/**
 * @Project: hw_java
 * @Description: 完全数计算
 * @Author: zzw
 */

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static boolean isPrefect(int num) {
        int f = 0;
        for (int i = 1; i <= num / 2; i++) {
            if (num % i == 0) {
                f += i;
            }
        }
        return f == num;
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int count = 0;
        for (int i = 1; i <= n; i++) {
            if (isPrefect(i)) {
                count++;
            }
        }
        System.out.print(count);
    }
}
